package cn.donting.jme.edit.ui.scenetree.meum;

import cn.donting.jme.edit.ui.scenetree.ClipBoard;
import cn.donting.jme.edit.ui.scenetree.meum.geometry.BoxMenuItem;
import cn.donting.jme.edit.ui.scenetree.meum.geometry.NodeMenuItem;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import javafx.scene.control.SeparatorMenuItem;

public class AddGeometryMenu extends AbsTreeMenu {
    public AddGeometryMenu() {
        super("3D对象");
        NodeMenuItem nodeMenuItem = new NodeMenuItem();
        SeparatorMenuItem separatorMenuItem = new SeparatorMenuItem();
        BoxMenuItem boxMenuItem=new BoxMenuItem();
        getItems().add(nodeMenuItem);
        getItems().add(separatorMenuItem);
        getItems().add(boxMenuItem);
    }

    @Override
    public boolean isAvailable(ClipBoard clipBoard) {
        Spatial selectSpatial = clipBoard.getSelectSpatial();
        if(selectSpatial!=null && selectSpatial instanceof Node){
            return true;
        }
        return false;
    }

    @Override
    public void action(ClipBoard clipBoard) {
    }


}
